<template>
  <view class="category">
    <navigator class="cate-item" v-for="item in category" :key="item.id" url="/pages/img-detail/index">  
      <view class="item-name">{{item.ename}}</view>
      <img :src="item.cover" alt="">
    </navigator>
  </view>
</template>

<script>
export default {
  name: 'category',
  data() { 
    return {
      category:[]
    }
  },
  mounted(){
    uni.setNavigationBarTitle({title:"分类"})
    this.getList()
  },
  methods:{
    getList(){
      this.request({
        url:'http://service.picasso.adesk.com/v1/vertical/category'
      }).then(res=>{
        console.log(res);
        this.category = res.data.res.category
      })
    }
  }
 }
</script>

<style lang="scss" scoped>
.item-name{
  background-color: pink;
}
</style>